<template>
  <div class="heard_info">
    <div class="info_p">
      <p class="title">{{ info.report_name ? info.report_name : '暂无' }}</p>
      <p>教师：{{ info.teacher_name }}</p>
      <p v-if="info.classData.length < 2">起止时间：{{ info.start_time }} 至 {{ info.end_time }}</p>
      <p v-else>起止时间：{{ info.report_time }}</p>
    </div>

    <div class="c_info">
      <div class="class_count">
        <div class="content">
          <el-button @click="$emit('openCourse', true)" v-if="info.classData.length > 1" type="primary" size="small"
            style="margin:-15px 0 10px 0;">选择课程</el-button>
          <div class="cla">课程数量</div>
          <div class="num">{{ info.classData.length }}节</div>
        </div>
      </div>
      <div style="height: 132px;overflow-y: auto;overflow-x: hidden;margin: 6px 0;">
        <div class="table" v-for="(item, i) in info.classData" :key="i">
          <div class="course_name">
            课程名称：{{ item.course_name }}
          </div>
          <div>{{ item.class_name }}</div>
          <div>{{ item.course_data }}</div>
          <div>{{ item.course_time }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    info: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      // classData: [
      //   { name: '第一节', time: '2024-01-26 16:54:55', class: '三年级（1）班', subject: '语文' },
      //   { name: '第二节', time: '2024-01-26 16:54:55', class: '三年级（1）班', subject: '语文' },
      //   { name: '第三节', time: '2024-01-26 16:54:55', class: '三年级（1）班', subject: '语文' },
      //   { name: '第三节', time: '2024-01-26 16:54:55', class: '三年级（1）班', subject: '语文' },
      // ],
      // info: {
      //   title: '20240130教学分析报告',
      //   name: '李娜',
      //   startTime: '2024-01-26',
      //   endTime: '2024-01-30',
      // }
    }
  },
  methods: {
  },
}
</script>

<style scoped>
.heard_info {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: #fff;
  /* border-radius: 8px; */
  /* margin: 10px 30px; */
  height: 132px;
  overflow: hidden;
  font-family: SourceHanSansCN, SourceHanSansCN;
  /* margin: 30px 30px 10px 30px; */
  background: url('../../../assets/images/teach_ai/row_info_bg.png') center center / 100% 100% no-repeat;

  .title {
    font-size: 22px;
  }


}

.info_p {
  font-size: 20px;
  line-height: 37px;
  padding: 5px 20px;
  margin: 5px;
  width: 100%;
  background: url('../../../assets/images/teach_ai/info_bg.png') center center / 100% 100% no-repeat;
}

.c_info {
  display: flex;

  .course_name {
    width: 260px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
  }

  .class_count {
    position: relative;
    font-size: 22px;
    background-color: #FFFFFF14;
    border-radius: 8px;
    text-align: center;
    width: 120px;
    height: 116px;
    margin: auto;

    .content {
      width: 100%;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }

    .num {
      margin-top: 20px;
    }

    .cla {
      color: #ffffffcf;
      font-size: 16px;
    }

  }

  .table {
    width: 700px;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    margin: 0 10px 6px 10px;
    line-height: 36px;
    height: 36px;
    background-color: #FFFFFF14;
    color: #ffffffcf;
    font-size: 16px;
  }
}
</style>